package com.info.dpunified.dpgen.domain;

import java.util.Date;

import org.xml.sax.helpers.NamespaceSupport;

public class RadarDefect 
{
	
	public static final String[] MONTHS = {"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
	public static final String SPLITTER = "-";
	
	
	public RadarDefect(String fileName)
	{
		fileName = fileName.replace(".xlsx", "");
		fileName = fileName.replace(".xls", "");
		
		if(fileName.indexOf(SPLITTER) > 0)
		{
			String[] identifiers = fileName.split(SPLITTER); 
			if(identifiers != null && identifiers.length == 3)
			{
				this.setProjectCode(identifiers[0]);
				String month = identifiers[1];
				for(int iMonth = 0; iMonth < MONTHS.length; iMonth++)
				{
					if(month.equalsIgnoreCase(MONTHS[iMonth]))
					{
						this.setMonth(iMonth+1);
						break;
					}
				}
				
				this.setYear(Integer.parseInt(identifiers[2]));
			}
		}
		
	}
	
	//Should not be used from outside
	private RadarDefect()
	{
		
	}
	
	String projectCode;
	int month;
	int year;
	String reviewName;
	String reviewDescription;
	String reviewStatus;
	String reviewCode;
	String reviewCreatedBy;
	String programCode;
	Date reviewCreationDate;
	Date reviewDateClosed;
	String reviewArtifactType;
	String reviewArtifactUnit;
	String reviewCycle;
	String reviewType;
	String reviewLocation;
	String reviewEffort;
	Date reviewDate;
	String artifactName;
	String artifactVersion;
	Date reviewSubmittedDate;
	String estimatedReviewEffort;
	String estimatedTaskEffort;
	String efficiency;
	String actualReviewEffort;
	String actualTaskEffort;
	String activityType;
	String noOfDefects;
	String artifactSize;
	String application;
	String module;
	String artifactLocation;
	String reviewRequestCode;
	String requestType;
	String defectName;
	String defectID;
	String defectDescription;
	String defectType;
	String defectStatus;
	String defectSeverity;
	String defectImpact;
	String defectPriority;
	Date defectDateIdentified;
	String defectReasonCode;
	Date defectDueDate;
	Date defectDateClosed;
	String defectCreatedBy;
	Date defectResolved;
	String defectAuthor;
	String defectActionCode;
	String defectInjectedStage;
	String defectInjectedBy;
	String defectDetectedStage;
	String defectDetectedBy;
	String defectStandardCode;
	String defectActionTaken;
	String defectCause;
	String defectAssignedTo;
	String closingComments;
	/**
	 * @return the projectCode
	 */
	public String getProjectCode() {
		return projectCode;
	}
	/**
	 * @param projectCode the projectCode to set
	 */
	public void setProjectCode(String projectCode) {
		this.projectCode = projectCode;
	}
	/**
	 * @return the month
	 */
	public int getMonth() {
		return month;
	}
	/**
	 * @param month the month to set
	 */
	public void setMonth(int month) {
		this.month = month;
	}
	/**
	 * @return the year
	 */
	public int getYear() {
		return year;
	}
	/**
	 * @param year the year to set
	 */
	public void setYear(int year) {
		this.year = year;
	}
	/**
	 * @return the reviewName
	 */
	public String getReviewName() {
		return reviewName;
	}
	/**
	 * @param reviewName the reviewName to set
	 */
	public void setReviewName(String reviewName) {
		this.reviewName = reviewName;
	}
	/**
	 * @return the reviewDescription
	 */
	public String getReviewDescription() {
		return reviewDescription;
	}
	/**
	 * @param reviewDescription the reviewDescription to set
	 */
	public void setReviewDescription(String reviewDescription) {
		this.reviewDescription = reviewDescription;
	}
	/**
	 * @return the reviewStatus
	 */
	public String getReviewStatus() {
		return reviewStatus;
	}
	/**
	 * @param reviewStatus the reviewStatus to set
	 */
	public void setReviewStatus(String reviewStatus) {
		this.reviewStatus = reviewStatus;
	}
	/**
	 * @return the reviewCode
	 */
	public String getReviewCode() {
		return reviewCode;
	}
	/**
	 * @param reviewCode the reviewCode to set
	 */
	public void setReviewCode(String reviewCode) {
		this.reviewCode = reviewCode;
	}
	/**
	 * @return the reviewCreatedBy
	 */
	public String getReviewCreatedBy() {
		return reviewCreatedBy;
	}
	/**
	 * @param reviewCreatedBy the reviewCreatedBy to set
	 */
	public void setReviewCreatedBy(String reviewCreatedBy) {
		this.reviewCreatedBy = reviewCreatedBy;
	}
	/**
	 * @return the programCode
	 */
	public String getProgramCode() {
		return programCode;
	}
	/**
	 * @param programCode the programCode to set
	 */
	public void setProgramCode(String programCode) {
		this.programCode = programCode;
	}
	/**
	 * @return the reviewCreationDate
	 */
	public Date getReviewCreationDate() {
		return reviewCreationDate;
	}
	/**
	 * @param reviewCreationDate the reviewCreationDate to set
	 */
	public void setReviewCreationDate(Date reviewCreationDate) {
		this.reviewCreationDate = reviewCreationDate;
	}
	/**
	 * @return the reviewDateClosed
	 */
	public Date getReviewDateClosed() {
		return reviewDateClosed;
	}
	/**
	 * @param reviewDateClosed the reviewDateClosed to set
	 */
	public void setReviewDateClosed(Date reviewDateClosed) {
		this.reviewDateClosed = reviewDateClosed;
	}
	/**
	 * @return the reviewArtifactType
	 */
	public String getReviewArtifactType() {
		return reviewArtifactType;
	}
	/**
	 * @param reviewArtifactType the reviewArtifactType to set
	 */
	public void setReviewArtifactType(String reviewArtifactType) {
		this.reviewArtifactType = reviewArtifactType;
	}
	/**
	 * @return the reviewArtifactUnit
	 */
	public String getReviewArtifactUnit() {
		return reviewArtifactUnit;
	}
	/**
	 * @param reviewArtifactUnit the reviewArtifactUnit to set
	 */
	public void setReviewArtifactUnit(String reviewArtifactUnit) {
		this.reviewArtifactUnit = reviewArtifactUnit;
	}
	/**
	 * @return the reviewCycle
	 */
	public String getReviewCycle() {
		return reviewCycle;
	}
	/**
	 * @param reviewCycle the reviewCycle to set
	 */
	public void setReviewCycle(String reviewCycle) {
		this.reviewCycle = reviewCycle;
	}
	/**
	 * @return the reviewType
	 */
	public String getReviewType() {
		return reviewType;
	}
	/**
	 * @param reviewType the reviewType to set
	 */
	public void setReviewType(String reviewType) {
		this.reviewType = reviewType;
	}
	/**
	 * @return the reviewLocation
	 */
	public String getReviewLocation() {
		return reviewLocation;
	}
	/**
	 * @param reviewLocation the reviewLocation to set
	 */
	public void setReviewLocation(String reviewLocation) {
		this.reviewLocation = reviewLocation;
	}
	/**
	 * @return the reviewEffort
	 */
	public String getReviewEffort() {
		return reviewEffort;
	}
	/**
	 * @param reviewEffort the reviewEffort to set
	 */
	public void setReviewEffort(String reviewEffort) {
		this.reviewEffort = reviewEffort;
	}
	/**
	 * @return the reviewDate
	 */
	public Date getReviewDate() {
		return reviewDate;
	}
	/**
	 * @param reviewDate the reviewDate to set
	 */
	public void setReviewDate(Date reviewDate) {
		this.reviewDate = reviewDate;
	}
	/**
	 * @return the artifactName
	 */
	public String getArtifactName() {
		return artifactName;
	}
	/**
	 * @param artifactName the artifactName to set
	 */
	public void setArtifactName(String artifactName) {
		this.artifactName = artifactName;
	}
	/**
	 * @return the artifactVersion
	 */
	public String getArtifactVersion() {
		return artifactVersion;
	}
	/**
	 * @param artifactVersion the artifactVersion to set
	 */
	public void setArtifactVersion(String artifactVersion) {
		this.artifactVersion = artifactVersion;
	}
	/**
	 * @return the reviewSubmittedDate
	 */
	public Date getReviewSubmittedDate() {
		return reviewSubmittedDate;
	}
	/**
	 * @param reviewSubmittedDate the reviewSubmittedDate to set
	 */
	public void setReviewSubmittedDate(Date reviewSubmittedDate) {
		this.reviewSubmittedDate = reviewSubmittedDate;
	}
	/**
	 * @return the estimatedReviewEffort
	 */
	public String getEstimatedReviewEffort() {
		return estimatedReviewEffort;
	}
	/**
	 * @param estimatedReviewEffort the estimatedReviewEffort to set
	 */
	public void setEstimatedReviewEffort(String estimatedReviewEffort) {
		estimatedReviewEffort = estimatedReviewEffort;
	}
	/**
	 * @return the estimatedTaskEffort
	 */
	public String getEstimatedTaskEffort() {
		return estimatedTaskEffort;
	}
	/**
	 * @param estimatedTaskEffort the estimatedTaskEffort to set
	 */
	public void setEstimatedTaskEffort(String estimatedTaskEffort) {
		estimatedTaskEffort = estimatedTaskEffort;
	}
	/**
	 * @return the efficiency
	 */
	public String getEfficiency() {
		return efficiency;
	}
	/**
	 * @param efficiency the efficiency to set
	 */
	public void setEfficiency(String efficiency) {
		efficiency = efficiency;
	}
	/**
	 * @return the actualReviewEffort
	 */
	public String getActualReviewEffort() {
		return actualReviewEffort;
	}
	/**
	 * @param actualReviewEffort the actualReviewEffort to set
	 */
	public void setActualReviewEffort(String actualReviewEffort) {
		this.actualReviewEffort = actualReviewEffort;
	}
	/**
	 * @return the actualTaskEffort
	 */
	public String getActualTaskEffort() {
		return actualTaskEffort;
	}
	/**
	 * @param actualTaskEffort the actualTaskEffort to set
	 */
	public void setActualTaskEffort(String actualTaskEffort) {
		this.actualTaskEffort = actualTaskEffort;
	}
	/**
	 * @return the activityType
	 */
	public String getActivityType() {
		return activityType;
	}
	/**
	 * @param activityType the activityType to set
	 */
	public void setActivityType(String activityType) {
		this.activityType = activityType;
	}
	/**
	 * @return the noOfDefects
	 */
	public String getNoOfDefects() {
		return noOfDefects;
	}
	/**
	 * @param noOfDefects the noOfDefects to set
	 */
	public void setNoOfDefects(String noOfDefects) {
		noOfDefects = noOfDefects;
	}
	/**
	 * @return the artifactSize
	 */
	public String getArtifactSize() {
		return artifactSize;
	}
	/**
	 * @param artifactSize the artifactSize to set
	 */
	public void setArtifactSize(String artifactSize) {
		this.artifactSize = artifactSize;
	}
	/**
	 * @return the application
	 */
	public String getApplication() {
		return application;
	}
	/**
	 * @param application the application to set
	 */
	public void setApplication(String application) {
		this.application = application;
	}
	/**
	 * @return the module
	 */
	public String getModule() {
		return module;
	}
	/**
	 * @param module the module to set
	 */
	public void setModule(String module) {
		this.module = module;
	}
	/**
	 * @return the artifactLocation
	 */
	public String getArtifactLocation() {
		return artifactLocation;
	}
	/**
	 * @param artifactLocation the artifactLocation to set
	 */
	public void setArtifactLocation(String artifactLocation) {
		this.artifactLocation = artifactLocation;
	}
	/**
	 * @return the reviewRequestCode
	 */
	public String getReviewRequestCode() {
		return reviewRequestCode;
	}
	/**
	 * @param reviewRequestCode the reviewRequestCode to set
	 */
	public void setReviewRequestCode(String reviewRequestCode) {
		this.reviewRequestCode = reviewRequestCode;
	}
	/**
	 * @return the requestType
	 */
	public String getRequestType() {
		return requestType;
	}
	/**
	 * @param requestType the requestType to set
	 */
	public void setRequestType(String requestType) {
		this.requestType = requestType;
	}
	/**
	 * @return the defectName
	 */
	public String getDefectName() {
		return defectName;
	}
	/**
	 * @param defectName the defectName to set
	 */
	public void setDefectName(String defectName) {
		this.defectName = defectName;
	}
	/**
	 * @return the defectID
	 */
	public String getDefectID() {
		return defectID;
	}
	/**
	 * @param defectID the defectID to set
	 */
	public void setDefectID(String defectID) {
		this.defectID = defectID;
	}
	/**
	 * @return the defectDescription
	 */
	public String getDefectDescription() {
		return defectDescription;
	}
	/**
	 * @param defectDescription the defectDescription to set
	 */
	public void setDefectDescription(String defectDescription) {
		this.defectDescription = defectDescription;
	}
	/**
	 * @return the defectType
	 */
	public String getDefectType() {
		return defectType;
	}
	/**
	 * @param defectType the defectType to set
	 */
	public void setDefectType(String defectType) {
		this.defectType = defectType;
	}
	/**
	 * @return the defectStatus
	 */
	public String getDefectStatus() {
		return defectStatus;
	}
	/**
	 * @param defectStatus the defectStatus to set
	 */
	public void setDefectStatus(String defectStatus) {
		this.defectStatus = defectStatus;
	}
	/**
	 * @return the defectSeverity
	 */
	public String getDefectSeverity() {
		return defectSeverity;
	}
	/**
	 * @param defectSeverity the defectSeverity to set
	 */
	public void setDefectSeverity(String defectSeverity) {
		this.defectSeverity = defectSeverity;
	}
	/**
	 * @return the defectImpact
	 */
	public String getDefectImpact() {
		return defectImpact;
	}
	/**
	 * @param defectImpact the defectImpact to set
	 */
	public void setDefectImpact(String defectImpact) {
		this.defectImpact = defectImpact;
	}
	/**
	 * @return the defectPriority
	 */
	public String getDefectPriority() {
		return defectPriority;
	}
	/**
	 * @param defectPriority the defectPriority to set
	 */
	public void setDefectPriority(String defectPriority) {
		this.defectPriority = defectPriority;
	}
	/**
	 * @return the defectDateIdentified
	 */
	public Date getDefectDateIdentified() {
		return defectDateIdentified;
	}
	/**
	 * @param defectDateIdentified the defectDateIdentified to set
	 */
	public void setDefectDateIdentified(Date defectDateIdentified) {
		this.defectDateIdentified = defectDateIdentified;
	}
	/**
	 * @return the defectReasonCode
	 */
	public String getDefectReasonCode() {
		return defectReasonCode;
	}
	/**
	 * @param defectReasonCode the defectReasonCode to set
	 */
	public void setDefectReasonCode(String defectReasonCode) {
		this.defectReasonCode = defectReasonCode;
	}
	/**
	 * @return the defectDueDate
	 */
	public Date getDefectDueDate() {
		return defectDueDate;
	}
	/**
	 * @param defectDueDate the defectDueDate to set
	 */
	public void setDefectDueDate(Date defectDueDate) {
		this.defectDueDate = defectDueDate;
	}
	/**
	 * @return the defectDateClosed
	 */
	public Date getDefectDateClosed() {
		return defectDateClosed;
	}
	/**
	 * @param defectDateClosed the defectDateClosed to set
	 */
	public void setDefectDateClosed(Date defectDateClosed) {
		this.defectDateClosed = defectDateClosed;
	}
	/**
	 * @return the defectCreatedBy
	 */
	public String getDefectCreatedBy() {
		return defectCreatedBy;
	}
	/**
	 * @param defectCreatedBy the defectCreatedBy to set
	 */
	public void setDefectCreatedBy(String defectCreatedBy) {
		this.defectCreatedBy = defectCreatedBy;
	}
	/**
	 * @return the defectResolved
	 */
	public Date getDefectResolved() {
		return defectResolved;
	}
	/**
	 * @param defectResolved the defectResolved to set
	 */
	public void setDefectResolved(Date defectResolved) {
		this.defectResolved = defectResolved;
	}
	/**
	 * @return the defectAuthor
	 */
	public String getDefectAuthor() {
		return defectAuthor;
	}
	/**
	 * @param defectAuthor the defectAuthor to set
	 */
	public void setDefectAuthor(String defectAuthor) {
		this.defectAuthor = defectAuthor;
	}
	/**
	 * @return the defectActionCode
	 */
	public String getDefectActionCode() {
		return defectActionCode;
	}
	/**
	 * @param defectActionCode the defectActionCode to set
	 */
	public void setDefectActionCode(String defectActionCode) {
		this.defectActionCode = defectActionCode;
	}
	/**
	 * @return the defectInjectedStage
	 */
	public String getDefectInjectedStage() {
		return defectInjectedStage;
	}
	/**
	 * @param defectInjectedStage the defectInjectedStage to set
	 */
	public void setDefectInjectedStage(String defectInjectedStage) {
		this.defectInjectedStage = defectInjectedStage;
	}
	/**
	 * @return the defectInjectedBy
	 */
	public String getDefectInjectedBy() {
		return defectInjectedBy;
	}
	/**
	 * @param defectInjectedBy the defectInjectedBy to set
	 */
	public void setDefectInjectedBy(String defectInjectedBy) {
		this.defectInjectedBy = defectInjectedBy;
	}
	/**
	 * @return the defectDetectedStage
	 */
	public String getDefectDetectedStage() {
		return defectDetectedStage;
	}
	/**
	 * @param defectDetectedStage the defectDetectedStage to set
	 */
	public void setDefectDetectedStage(String defectDetectedStage) {
		this.defectDetectedStage = defectDetectedStage;
	}
	/**
	 * @return the defectDetectedBy
	 */
	public String getDefectDetectedBy() {
		return defectDetectedBy;
	}
	/**
	 * @param defectDetectedBy the defectDetectedBy to set
	 */
	public void setDefectDetectedBy(String defectDetectedBy) {
		this.defectDetectedBy = defectDetectedBy;
	}
	/**
	 * @return the defectStandardCode
	 */
	public String getDefectStandardCode() {
		return defectStandardCode;
	}
	/**
	 * @param defectStandardCode the defectStandardCode to set
	 */
	public void setDefectStandardCode(String defectStandardCode) {
		this.defectStandardCode = defectStandardCode;
	}
	/**
	 * @return the defectActionTaken
	 */
	public String getDefectActionTaken() {
		return defectActionTaken;
	}
	/**
	 * @param defectActionTaken the defectActionTaken to set
	 */
	public void setDefectActionTaken(String defectActionTaken) {
		this.defectActionTaken = defectActionTaken;
	}
	/**
	 * @return the defectCause
	 */
	public String getDefectCause() {
		return defectCause;
	}
	/**
	 * @param defectCause the defectCause to set
	 */
	public void setDefectCause(String defectCause) {
		this.defectCause = defectCause;
	}
	/**
	 * @return the defectAssignedTo
	 */
	public String getDefectAssignedTo() {
		return defectAssignedTo;
	}
	/**
	 * @param defectAssignedTo the defectAssignedTo to set
	 */
	public void setDefectAssignedTo(String defectAssignedTo) {
		this.defectAssignedTo = defectAssignedTo;
	}
	/**
	 * @return the closingComments
	 */
	public String getClosingComments() {
		return closingComments;
	}
	/**
	 * @param closingComments the closingComments to set
	 */
	public void setClosingComments(String closingComments) {
		this.closingComments = closingComments;
	}
	
	public Object[] getInsertValues()
	{
		
		return new Object[] {projectCode, month,  year, reviewName,	reviewDescription,	reviewStatus, 	reviewCode,	reviewCreatedBy,	programCode,	reviewCreationDate, 	reviewDateClosed,	reviewArtifactType,	reviewArtifactUnit,	reviewCycle, 	reviewType,	reviewLocation,	reviewEffort,	reviewDate, 	artifactName,	artifactVersion,	reviewSubmittedDate,	estimatedReviewEffort, 	estimatedTaskEffort,	efficiency,	actualReviewEffort,	actualTaskEffort, 	activityType,	noOfDefects,	artifactSize,	application, 	module,	artifactLocation,	reviewRequestCode,	requestType, 	defectName,	defectID, 	defectDescription,	defectType, 	defectStatus,	defectSeverity, 	defectImpact,	defectPriority, 	defectDateIdentified,	defectReasonCode, 	defectDueDate,	defectDateClosed, 	defectCreatedBy,	defectResolved, 	defectAuthor,	defectActionCode, 	defectInjectedStage,	defectInjectedBy, 	defectDetectedStage,	defectDetectedBy, 	defectStandardCode,	defectActionTaken, 	defectCause,	defectAssignedTo, 	closingComments};
	}
	
}
